﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<GlassStore.ViewModels.GlassManagerViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	编辑眼镜
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>编辑眼镜:<%:Model.Glass.GlassName %></h2>
    <% Html.EnableClientValidation(); %>
    <% using (Html.BeginForm("Edit", "GlassManager", FormMethod.Post, new { enctype = "multipart/form-data" }))
     {%>
        <%: Html.ValidationSummary(true) %>
        
        <fieldset>
            <legend>详情</legend>
            
            <%:Html.EditorFor(m => m.Glass, new { TopCatalogues = Model.TopCatalogues, MaterialList = Model.MaterialList, StyleList = Model.StyleList, OpticsGlasses = Model.OpticsGlasses, SunGlasses = Model.SunGlasses })%>
            
            <%if(Model.Glass.GlassPictures!=null&&Model.Glass.GlassPictures.Count > 0)
            foreach (var item in Model.Glass.GlassPictures.ToList())
            { %>
            <input type="checkbox" name="DeletedPictureId" value="<%:item.PictureId %>" />删除
            <img src="<%:item.PictureURL %>" alt="没有图片" /><br/>
            <% } %>

            <p>
                <input type="submit" value="保存" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%: Html.ActionLink("返回", "Index") %>
    </div>

</asp:Content>

